package net.sh.dpinfrastructure.sms;

import java.util.HashMap;
import java.util.Map;

import net.sh.dpinfrastructure.config.DPConfig;
import net.sh.dpinfrastructure.http.DPHttpClientHttp;
import net.sh.dpinfrastructure.http.DPHttpResponse;
import net.sh.dpinfrastructure.log.DPLogger;


/**
 * 
 * 短信
 * 
 * @version 1.0
 * @since JDK1.7
 * @author shaohui
 * @company 上海朝阳永续信息技术有限公司
 * @copyright (c) 2015 SunTime Co'Ltd Inc. All rights reserved.
 * @date 2015年9月10日 下午9:39:12
 */
public class DPSms {
    
    private DPHttpClientHttp http;
    
    private DPConfig config;
    
    private static final DPLogger LOGGER = new DPLogger(DPSms.class);
    
    public DPSms(DPHttpClientHttp http, DPConfig config) {
        this.http = http;
        this.config = config;
    }
    
    /**
     * 
     * 发送短信
     *
     * @param mobile 手机号
     * @param content 发送内容
     * @return
     * 
     * @author shaohui
     * @date 2015年9月17日 下午5:29:19
     */
    public Map<String, Object> send(String mobile, String content) {
        Map<String, Object> resultMap = new HashMap<String, Object>();
        String url = "http://apis.baidu.com/sms_net/sms_net_sdk/sms_net_sdk";
        Map<String, String> headParams = new HashMap<String, String>();
        headParams.put("apikey", "9aecd2a3a3b98d0185038b18fadf953b");
        Map<String, String> params = new HashMap<String, String>();
        params.put("mobile", mobile);
        params.put("content", "【数据平台】\n" + content);
        DPHttpResponse response = http.get(url, headParams, params);
        
        return null;
    }
    
}
